class Users
  attr_accessor :github, :emails, :followers, :keys

  def initialize(github)
    @github = github
    @emails = UsersEmails.new(github)
    @followers = UsersFollowers.new(github)
    @keys = UsersKeys.new(github)
  end

  def getUser(user=nil)
    url = (user != nil and user != @github.username) ?
        'users/%s' % user : 'user'
    @github.get(url)
  end

  def updateUser(name=nil, email=nil, blog=nil, company=nil,
      location=nil, hireable=FALSE, bio=nil)
    params = {
        :name => name,
        :email => email,
        :blog => blog,
        :company => company,
        :location => location,
        :hireable => hireable,
        :bio => bio
    }
    params = @github.removeEmptyParams(params)
    data = params.to_json
    @github.patch('user', data)
  end
end

    